 
#include "PwrMgnt.h"

#if defined (pwrmgnt_v1_1) || defined (pwrmgnt_v2_1) || defined (LIB_BUILD)
 /******************************************************************************
 * Function:        WAKEUP_SOURCE PwrMgnt_WakeupSource(void)
 *
 * PreCondition:    None   
 *
 * Side Effects:    None
 *
 * Overview:        This function returns the source of wakeup.
 *
 * Input:           None
 *
 * Returns:         WAKEUP_SOURCE - Enum value representing the source of wakeup
 *
 * Note:            None
 *****************************************************************************/
WAKEUP_SOURCE PwrMgnt_WakeupSource(void)
{
   if(RCONbits.SLEEP)
   {
      return(WAKEUP_SLEEP);
   }
   if(RCONbits.IDLE)
   {
      return(WAKEUP_IDLE);
   }
}

#else
#warning "Selected device not supports this function"
#endif
